package com.cysd.ewmxns.sdw_utils

import com.hlyj.http.base.tool.lib_hlyj_base.BaseApplication
import com.tencent.vasdolly.helper.ChannelReaderUtil


object AppUtil {

    /**
     * 渠道号
     */
    fun getChannel():String{
        val channel = ChannelReaderUtil.getChannel(BaseApplication.instance.applicationContext)
        if (channel.isEmpty()){
            return "baidu"
        }
        return channel
    }

    /**
     * 获取应用版本名称
     */
    fun getVersionName(): String {
        return try {
            val context = BaseApplication.instance.applicationContext
            context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: ""
        } catch (e: Exception) {
            "1.0.0" // 返回默认版本号
        }
    }






}